import { IsNotEmpty, IsString, IsNumber } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreatePostDto {
  @ApiProperty({
    description: '帖子标题',
    example: '这是一个帖子标题',
  })
  @IsNotEmpty({ message: '标题不能为空' })
  @IsString({ message: '标题必须是字符串' })
  title: string;

  @ApiProperty({
    description: '帖子内容',
    example: '这是帖子的详细内容',
  })
  @IsNotEmpty({ message: '内容不能为空' })
  @IsString({ message: '内容必须是字符串' })
  content: string;

  @ApiProperty({
    description: '节点ID',
    example: 1,
  })
  @IsNotEmpty({ message: '节点ID不能为空' })
  @IsNumber({}, { message: '节点ID必须是数字' })
  nodeId: number;
}
